<%@ page import="pc.system.*,wstrader.*,wstrader.task.*" %>
<%
    Users user = Trader.getUser(request.getParameter("uid"));
	if (!user.Authenticated()) {
		response.sendRedirect("logon.jsp");
		return;
	}

	wstrader.task.home.DailyBasis task = user.home.daily_basis;

	((Tasks)task.getOwner()).clearFocus();
	task.setFocus(true);
	Trader.window_width = "95%";
	//task.forwardToChild(user.getuid());		
	ResultSet rs;	
%>

<%@include file="../header.jsp"%>

<script language="JavaScript">
function doFilter()
{
	var form = document.formMain;
	form.action = "home.daily-basis.list.jsp";
	form.submit();
}

function clickCardView_T(row)
{
	var form = document.formMain;
	form.daily_basis.value = row.id;
	if (row == null) row = old_row_obj;
	form.action = "home.physical.daily-basis.card.jsp";
	form.submit();	
}

function CView_T(row_obj) 
{
	highlightOn(row_obj);
	clickCardView_T(row_obj);	
	//formMain.submit();
}

function clickCardView_F(row)
{
	var form = document.formMain;
	if (row == null) row = old_row_obj;
	form.action = "home.futures.daily-basis.card.jsp";
	form.submit();	
}

function CView_F(row_obj) 
{
	highlightOn(row_obj);
	clickCardView_T(row_obj);	
	//formMain.submit();
}

function logout()
{	
	var form = document.formMain;
	form.taskID.value = "<%=Trader.taskLogout%>";
	form.linkPage.value = "logon.jsp";
	form.action = "Trader";
	form.submit();
}

function changePassword()
{
	var form = document.formMain;
	form.action = "change-password.jsp";
	form.submit();
}

</script>
<style type="text/css">
<!--
.style1 {
	font-family: Arial;
	font-size: 12px;
}
.style5 {
	font-family: DymaxionScript;
	font-size: 24px;
	color: #FF0000;
}
.style7 {font-family: Arial; font-size: 12px; color: #000000; }
.style15 {font-family: Arial; font-size: 12px; color: #000000; font-weight: bold; }
.style3 {font-weight: bold}
-->
</style>

<form method="POST" name="formMain" action="" onSubmit="">				  
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="left" valign="middle">
<table width="59%"  border="0" cellspacing="0" cellpadding="0">
          <tr align="left" bgcolor="#FFFFFF">
            <td colspan="6" valign="middle"><strong><span class="style7"><img src="images/trade-dailybasis.jpg" width="220" height="30"></span></strong></td>
          </tr>
          <tr bgcolor="#FFFFFF">
            <td width="150" align="center" valign="middle"><strong><span class="style1">Date</span></strong></td>
            <td width="150" align="center" valign="middle"><strong><span class="style1">Orgin</span></strong></td>
            <td width="150" align="center" valign="middle"><strong><span class="style1">Grade</span></strong></td>
            <td width="150" align="center" valign="middle"><strong><span class="style1">Offer Type</span></strong></td>
            <td width="150" align="center" valign="middle"><strong><span class="style1">Last Date</span></strong></td>
            <td width="150" align="center" valign="middle"><strong><span class="style1">Supplier</span></strong></td>
          </tr>
		
          <tr>
            <td width="150"><select name="db_date" size="9" id="db_date" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
              <%@include file="include/DailyBasisDateList.jsp"%>
            </select></td>
            <td width="150"><select name="origin" size="9" id="origin" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		  		<option value="0" selected>All</option>
	  			<%
					task.getResponse().setOption("origin_master","name");
					task.getResponse().setSelected("origin");
				%>	  
            </select></td>
            <td width="150"><select name="grade" size="9" id="grade" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
		  		<option value="0" selected>All</option>
	  			<%
					task.getResponse().setOption("grade_master","name");
					task.getResponse().setSelected("grade");
				%>	  
            </select></td>
			
            <td width="150"><select name="otype" size="9" id="otype" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
              <option value="0" selected>All</option>
              <option value="P">Purchase</option>
              <option value="S">Sales</option>
  			  <%task.getResponse().setSelected("otype");%>
            </select></td>
			
            <td width="150"><select name="ls_date" size="9" id="ls_date" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
              <%@include file="include/DailyBasisLsDateList.jsp"%>
            </select></td>
            <td width="150"><select name="supplier" size="9" id="supplier" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
	  			<option value="0" selected>All</option>
	  			<%
					task.getResponse().setOption(task.getCompanyList("supplier"));
					task.getResponse().setSelected("supplier");
				%>      
            </select></td>
          </tr>
        </table>		
		</td>
      </tr>
      <tr>
        <td width="74%">
	  		<table width="100%" height = "30"  border="1" cellpadding="0" cellspacing="0" bordercolor="#EEEEEE">
        		<tr bordercolor="#AAAAAA">
          			<td width="4%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">Id</span></strong></td>
          			<td width="7%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">Origin</span></strong></td>
          			<td width="24%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">Grade</span></strong></td>
          			<td width="10%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">Supplier</span></strong></td>
          			<td width="6%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">Tons</span></strong></td>
          			<td width="6%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">Ls.Dt</span></strong></td>
          			<td width="7%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">Outright</span></strong></td>
          			<td width="6%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">Diff</span></strong></td>
          			<td width="7%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">Ter.Mth</span></strong></td>
          			<td width="1%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">&nbsp;</span></strong></td>
          			<td width="8%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">B.Outright</span></strong></td>
          			<td width="6%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">B.Diff</span></strong></td>
          			<td width="8%" align="center" bgcolor="#EEEEEE"><strong><span class="style1">B.Ter.Mth</span></strong></td>
					
        		</tr>
			</table>		
		</td>
      </tr>
      <tr>
        <td>
			<DIV id=scroll1 style="BORDER:0px ; OVERFLOW: auto; WIDTH: 100%; HEIGHT: 260px;">
				<%@include file="home.physical.daily-basis.list.details.jsp"%>
			</DIV>
		</td>
      </tr>
      <tr>
        <td align="right"><img src="images/cardview.jpg" width="55" height="18" onClick="clickCardView_T();"></td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>	
	

    <input type="hidden" name="taskID"    id = "taskID"   value="0">
    <input type="hidden" name="linkPage"  id = "linkPage" value="">
	<input type="hidden" name="uid"        id="uid"       value="<%=user.getuid()%>">	
	<span class="style3">
	<input name="new_rec" type="hidden" id="new_rec" value="0">
    <input name="daily_basis" type="hidden" id="daily_basis" value="0">	
    </span>
</form>  

<%@include file="../footer.jsp"%>
